package Fenetre;

import java.awt.Dimension;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import com.DB.DBConnector;

public class BDConfiguratorDialog extends JDialog{
	
	private static final long serialVersionUID = 8466705470905300574L;
	
	private JLabel label_adresse = null;
	private JLabel label_utilisateur = null;
	private JLabel label_password = null;
	
	private JTextField txt_adresse = null;
	private JTextField txt_utilisateur = null;
	private JTextField txt_password  = null;
	
	private JPanel panel_principal = null;
	
	public BDConfiguratorDialog(){
		super((JFrame)null, "Configuration de la BD");
		this.setSize(600, 50);
		this.setLocationRelativeTo(null);
		this.setResizable(false);
		this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
		this.ajouterObjetsGraphiques();
		this.setContentPane(panel_principal);
		this.setVisible(true);
	}
	
	private void ajouterObjetsGraphiques(){
		
		panel_principal = new JPanel();
		
		label_adresse = new JLabel("Adresse ");
		label_utilisateur = new JLabel("Utilisateur ");
		label_password = new JLabel("Password ");
		
		txt_adresse = new JTextField();
		txt_adresse.setPreferredSize(new Dimension(100, 30));
		txt_adresse.setText(DBConnector.adresse);
		
		txt_utilisateur = new JTextField();
		txt_utilisateur.setPreferredSize(new Dimension(100, 30));
		txt_utilisateur.setText(DBConnector.utilisateur);
		
		txt_password = new JTextField();
		txt_password.setPreferredSize(new Dimension(100, 30));
		txt_password.setText(DBConnector.password);
		
		panel_principal.add(label_adresse);
		panel_principal.add(txt_adresse);
		
		panel_principal.add(label_utilisateur);
		panel_principal.add(txt_utilisateur);
		
		panel_principal.add(label_password);
		panel_principal.add(txt_password);
	}

}
